<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ taglib uri="http://www.atg.com/taglibs/daf/dspjspTaglib1_0"
	prefix="dsp"%>
<dsp:page>
	<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%@include file="style.jspf"%>
<title>demo</title>
<dsp:importbean bean="/atg/userprofiling/Profile" />
<dsp:importbean bean="/atg/userprofiling/ProfileFormHandler" />
<dsp:importbean bean="/atg/dynamo/droplet/Switch" />
<dsp:importbean bean="/atg/dynamo/droplet/ErrorMessageForEach" />
<dsp:importbean bean="/atg/dynamo/droplet/ForEach" />
<dsp:importbean bean="/atg/commerce/payment/CreditCardTools" />
<dsp:importbean
	bean="/atg/commerce/order/purchase/CreateCreditCardFormHandler" />
	</head>
	<body>
		<div id="wrap" class="clear-block">
			<div id="header">
				<dsp:include page="header.jsp" />
			</div>
			<h3>Payment Info</h3>
			<div class="errorBox">Please fill all required fields below</div>
			<div class="shippingAddr">
				<p class="text">Please fill in your payment info below, it will
					be your default payment information.</p>
				<dsp:form action="paymentInfo.jsp" method="post">
					<table>
						<tbody>
							<tr>
								<td width="130">First Name *</td>
								<td><dsp:input
										bean="ProfileFormHandler.editValue.firstName"
										beanvalue="Profile.billingAddress.firstName" id="pFirstName"
										iclass="textInput" required="<%=true%>" /></td>
							</tr>
							<tr>
								<td>Last Name *</td>
								<td><dsp:input bean="ProfileFormHandler.editValue.lastName"
										beanvalue="Profile.billingAddress.lastName" id="pLastName"
										iclass="textInput" required="<%=true%>" /></td>
							</tr>
							<tr>
								<td>Address Line 1 *</td>
								<td><dsp:input bean="ProfileFormHandler.editValue.address1"
										beanvalue="Profile.billingAddress.address1" id="pAddress1"
										iclass="textInput" required="<%=true%>" /></td>
							</tr>
							<tr>
								<td>Address Line 2</td>
								<td><dsp:input bean="ProfileFormHandler.editValue.address2"
										beanvalue="Profile.billingAddress.address2" id="pAddress2"
										iclass="textInput" /></td>
							</tr>
							<tr>
								<td>City *</td>
								<td><dsp:input bean="ProfileFormHandler.editValue.city"
										beanvalue="Profile.billingAddress.city" id="pCity"
										iclass="textInput" required="<%=true%>" /></td>
							</tr>
							<tr>
								<td>State *</td>
								<td><dsp:input bean="ProfileFormHandler.editValue.state"
										beanvalue="Profile.billingAddress.state" id="pState"
										iclass="textInput" required="<%=true%>" /></td>
							</tr>
							<tr>
								<td>Country *</td>
								<td><dsp:input bean="ProfileFormHandler.editValue.country"
										beanvalue="Profile.billingAddress.country" id="pCountry"
										iclass="textInput" required="<%=true%>" /></td>
							</tr>
							<tr>
								<td>Zip/Postal Code *</td>
								<td><dsp:input
										bean="ProfileFormHandler.editValue.postalCode"
										beanvalue="Profile.billingAddress.postalCode" id="pPostalCode"
										iclass="textInput" required="<%=true%>" /></td>
							</tr>
							<tr>
								<td>Credit Card Type *</td>
								<td><dsp:select id="pCardType"
										bean="ProfileFormHandler.editValue.creditCardType">
										<dsp:droplet name="ForEach">
											<dsp:param name="array" bean="CreditCardTools.cardTypesMap" />
											<dsp:setvalue param="creditCard" paramvalue="element" />
											<dsp:oparam name="output">
												<dsp:droplet name="Switch">
													<dsp:getvalueof var="cardType"
														bean="Profile.defaultCreditCard.creditCardType" />
													<dsp:getvalueof var="selectValue" param="key" />
													<dsp:param name="value" value="${selectValue eq cardType}" />
													<dsp:oparam name="true">
														<dsp:option paramvalue="key" selected="true">
															<dsp:valueof param="creditCard" />
														</dsp:option>
													</dsp:oparam>
													<dsp:oparam name="false">
														<dsp:option paramvalue="key">
															<dsp:valueof param="creditCard" />
														</dsp:option>
													</dsp:oparam>
												</dsp:droplet>
											</dsp:oparam>
										</dsp:droplet>
									</dsp:select></td>
							</tr>
							<tr>
								<td>Credit Card Number *</td>
								<td><dsp:input
										bean="ProfileFormHandler.editValue.creditCardNumber"
										beanvalue="Profile.defaultCreditCard.creditCardNumber"
										id="pCreditCardNumber" iclass="textInput" required="<%=true%>" /></td>
							</tr>
							<tr>
								<td>Expiration Date *</td>
								<td><dsp:input
										bean="ProfileFormHandler.editValue.expirationMonth"
										beanvalue="Profile.defaultCreditCard.expirationMonth"
										id="pExpMonth" required="<%=true%>" size="5" />&nbsp;&nbsp;<dsp:input
										bean="ProfileFormHandler.editValue.expirationDayOfMonth"
										beanvalue="Profile.defaultCreditCard.expirationDayOfMonth"
										id="pExpDay" required="<%=true%>" size="5" />&nbsp;&nbsp;<dsp:input
										bean="ProfileFormHandler.editValue.expirationYear"
										beanvalue="Profile.defaultCreditCard.expirationYear"
										id="pExpYear" required="<%=true%>" size="5" /></td>
							</tr>
						</tbody>
					</table>

					<div class="btnBox">
						<dsp:input type="submit" bean="ProfileFormHandler.updatePaymentInfo"
							value="Save" iclass="btn" />
					</div>
				</dsp:form>
			</div>
		</div>
	</body>
</dsp:page>
</html>